﻿/*****************************************************
**Copyright(C), 2021-2022, Ciqtek Technology.
**Version:     2.0
**Author:      hujiarui
**Date:        2023/06/28
**Description: 管理基类派生类，Demo使用
*****************************************************/

#ifndef DEMOITEMMANAGER_H
#define DEMOITEMMANAGER_H

#include "../../ofuidll_global.h"

#include "BaseItemManager.h"

namespace OfUI {

	class OFUIDLL_EXPORT DemoItemManager : public BaseItemManager
	{
		Q_OBJECT

	public:
		/**
		 * @brief  DemoItemManager 构造函数
		 * @param  pScene
		 * @param  parent
		 * @return
		 */
		DemoItemManager(QGraphicsScene* pScene, QObject *parent = 0);

		/**
		 * @brief  ~DemoItemManager 析构函数
		 * @return
		 */
		virtual ~DemoItemManager();

	public:
		/**
		 * @brief  removeSelect 删除选中Item
		 * @return void
		 */
		void removeSelect();

	protected:
		/**
		 * @brief  select 判断坐标点是否选中Item
		 * @param  point
		 * @return BaseGraphicsItem*
		 */
		BaseGraphicsItem* select(const QPointF& point) override;

		/**
		 * @brief  createItem 创建Item
		 * @return BaseGraphicsItem*
		 */
		BaseGraphicsItem* createItem() override;

		private Q_SLOTS :
		/**
		 * @brief  slotItemAddFinished Item添加完成响应
		 * @return void
		 */
		void slotItemAddFinished();

		/**
		 * @brief  slotItemDestoryed Item销毁响应
		 * @return void
		 */
		void slotItemDestoryed();

		/**
		 * @brief  slotItemStateChanged Item状态变化响应
		 * @param  state
		 * @return void
		 */
		void slotItemStateChanged(int state);

		/**
		 * @brief  slotItemDataChanged Item数据变化响应
		 * @return void
		 */
		void slotItemDataChanged();

		/**
		 * @brief  slotItemEditText Item双击编辑响应
		 * @return void
		 */
		void slotItemEditText();
	};

}

#endif // DEMOITEMMANAGER_H
